const sqlite3 = require('sqlite3').verbose();
const db = new sqlite3.Database('./tang_poems.db');

const poems = [
  {
    title: "咏鹅",
    author: "骆宾王",
    dynasty: "唐",
    content: "鹅，鹅，鹅，曲项向天歌。白毛浮绿水，红掌拨清波。"
  },
  {
    title: "静夜思",
    author: "李白",
    dynasty: "唐",
    content: "床前明月光，疑是地上霜。举头望明月，低头思故乡。"
  }
  // 可以继续添加更多一年级古诗
];

db.serialize(() => {
  const stmt = db.prepare('INSERT INTO tang_poems (title, author, dynasty, content) VALUES (?, ?, ?, ?)');
  poems.forEach(poem => {
    stmt.run(poem.title, poem.author, poem.dynasty, poem.content);
  });
  stmt.finalize();
  console.log('一年级古诗已导入数据库');
});

db.close();

